#include <stdio.h>

int main(int argc, char* argv[]){
    char *source=argv[1];
    char *target=argv[2];
    FILE *fp1,*fp2;
    if((fp1=fopen(source,"r"))==NULL){
        printf("Entry file doesn't exist!\n");
    }
    if((fp2=fopen(target,"w"))==NULL){
        printf("Output file can't be created!\n");
    }
    char ch;
    int i;
    while((ch=fgetc(fp1))!=EOF){
        if(ch=='@'){
            fputc('>',fp2);
            for(i=0;i<2;i++){
                while((ch=fgetc(fp1))!='\n'){
                    fputc(ch,fp2);
                }
                fputc('\n',fp2);
            }
        }
    }
    fclose(fp1);
    fclose(fp2);
    printf("Convertion finish.\n");
    return 0;
}
